package com.urbanski.util.io;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class FileUtils
{
	public static void printFileByLine(File file) throws IOException
	{
		BufferedReader reader = null;
		
		try
		{
			reader = new BufferedReader(new FileReader(file));
			String line;
			
			while ((line = reader.readLine()) != null)
			{
				System.out.println(line);
			}
		}
		finally
		{
			close(reader);
		}
	}
	
	public static void close(Reader reader)
	{
		if (reader != null)
		{
			try
			{
				reader.close();
			}
			catch (IOException e)
			{
				
			}
		}
	}
}
